package com.lei.dao;


import org.hibernate.Query;
import org.springframework.stereotype.Repository;

import com.lei.pojo.User;

@Repository
public class UserDao extends BaseDao<User,Integer> {
	
	public User findByUsernameAndPassword(User user){
		String hql="from User where username=? and password=?";
		Query query=getSession().createQuery(hql);
		query.setParameter(0, user.getUsername());
		query.setParameter(1, user.getPassword());
		return (User) query.uniqueResult();
	}

}
